﻿using System;
using System.Xml.Serialization;

namespace SuppKids.Licensing.Common
{
    [Serializable]
    [XmlRoot(ElementName = "license")]
    public class LicenseDTO
    {
        public LicenseDTO()
        {
            this.LicenseId = Guid.NewGuid();
            this.PaymentDate = DateTime.Now;
            this.ExpirationDate = DateTime.Now;
        }

        public const string LicenseIdField = "licenseId";
        public const string CMIDField = "cmid";
        public const string ClientNameField = "clientName";
        public const string PaymentDateField = "paymentDate";
        public const string ExpirationDateField = "expirationDate";
        public const string MenuTypeField = "menuType";

        [XmlElement(LicenseIdField)]
        public Guid LicenseId { get; set; }

        [XmlElement(CMIDField)]
        public string CMID { get; set; }

        [XmlElement(ClientNameField)]
        public string ClientName { get; set; }

        [XmlElement(PaymentDateField)]
        public DateTime PaymentDate { get; set; }

        [XmlElement(ExpirationDateField)]
        public DateTime ExpirationDate { get; set; }

        [XmlElement(MenuTypeField)]
        public MenuType MenuType { get; set; }
    }
}